layui.use(['table', 'layer'],function(){
    var table = layui.table,
        $=layui.$,
        layer=layui.layer;
    getCourseLog();
    function getCourseLog(data){
        $.ajax({
            url:"/courseLog/selCourseLog",
            type:"post",
            dataType:"json",
            data:{"data":data},
            success:function(data){
                CourseLog(data.data);
            }
        })
    }
    function CourseLog(data){
        table.render({
            elem: '#div_table'
            ,width:900
            ,data:data
            ,page: true
            ,cols: [[
                {field: 'course_id', title: '商品编号', width:100,align:'center'}
                ,{field: 'course_name', title: '商品名称', width:150,align:'center'}
                ,{field: 'course_nprice', title: '销售价格', width:200,align:'center'}
                ,{field: 'course_status', title: '商品状态', width: 100,align:'center',templet:function (d) {
                        if(d.course_status=="2"){
                            return "上架";
                        }else if(d.course_status=="3"){
                            return "未上架";
                        }
                    }}
                ,{field: 'course_cstatus', title: '审核状态', width: 100,align:'center',templet:function(d){
                        if(d.course_cstatus=="3"){
                            return "未审核";
                        }else if(d.course_cstatus=="4"){
                            return "审核中";
                        }else if(d.course_cstatus=="5"){
                            return "审核失败";
                        }else if(d.course_cstatus=="6"){
                            return "审核成功";
                        }
                    }}
                ,{field: 'create_date', title: '操作信息', width: 250,align:'center'}
            ]]
        });
    }
});